import React from 'react';
import { Select } from 'antd';
const YearSelector = props => {
    const onChange = (value) => {
        console.log(`selected ${value}`);
        props.setYear(value);
        props.setCount(props.Count+1);
        // console.log(props.Count);
    };
    const onSearch = (value) => {
        console.log('search:', value);
    };
	return <Select
		style={{ width: "15vw" }}
		showSearch
		placeholder={props.DefaultText}
		// optionFilterProp="children"
		onChange={onChange}
		onSearch={onSearch}
		filterOption={(input, option) =>
			(option?.label ?? '').toLowerCase().includes(input.toLowerCase())
		}
		options={[
			{ label: '2019', value: '2019' },
			{ label: '2020', value: '2020' },
			{ label: '2021', value: '2021' },
		]}
	/>
    };
export default YearSelector;